// WiFiManager.h
#ifndef WIFI_MANAGER_H
#define WIFI_MANAGER_H

#include <WiFi.h>
#include <WebServer.h>

class WiFiManager {
public:
    WiFiManager(const char* defaultSSID, const char* defaultPass);
    void begin();
    void handleClient();
    bool isConnected();
    bool isAPMode();
    void getCredentials(char* ssidBuf, char* passBuf);
    
private:
    void connectToWiFi();
    void handleRoot();
    void handleConfig();
    
    WebServer server;
    char ssid[32];
    char password[64];
    bool apModeActive = false;
};

#endif